package com.jqing.lib;

import android.app.Activity;
import android.os.Bundle;
import android.widget.Toast;
import com.jqing.lib.print.Print;

/**
 * Created by chshqiang on 15-3-30.
 * 基础activity
 */
public abstract class BaseActivity extends Activity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView();
        initializeView();
        initializeData();
        setup();
    }

    protected abstract void setContentView();

    protected abstract void initializeView();

    protected abstract void initializeData();

    protected abstract void setup();

    protected void toast(String msg) {
        Toast.makeText(BaseActivity.this, msg, Toast.LENGTH_LONG).show();
    }

    protected void print(String o) {
        Print.m(o);
    }

    protected void error(String o) {
        Print.e(o);
    }
}
